package com.cobra.activiti.enums;
import lombok.Getter;

/**
 * @author yaobin
 * @date 2020/4/20 0020 14:43
 * @Description 结果枚举类
 */
@Getter
public enum ProcessInstanceFinishEnum {

    FINISHED("0", "finished"),
    UNFINISHED("1", "unfinished");

    public String code;

    public String message;

    ProcessInstanceFinishEnum(String code, String message) {
               this.code = code;
        this.message = message;
    }

    public static ProcessInstanceFinishEnum parse(String code) {
        ProcessInstanceFinishEnum[] values = values();
        for (ProcessInstanceFinishEnum value : values) {
            if (value.getCode() == code) {
                return value;
            }
        }
        throw new RuntimeException("Unknown code of ResultEnum");
    }
}